home *** CD-ROM | disk | FTP | other *** search
Wrap
/* v1.00 Roll Marko Seppänen marko.seppanen@wwnet.fi */ address IMAGEENGINEER Options results if arg()=0 then exit x=arg(1) parse var x pic xroll yroll . MARK pic PRIMARY PROJECT_INFO pic WIDTH picwidth=result PROJECT_INFO pic HEIGHT picheight=result PROJECT_INFO pic ZOOM origzoomval=result 'PROJECT_INFO' pic 'BOX' cropbox=result parse var cropbox TEST1 TEST2 TEST3 TEST4 . signal on error /* DOES CROPBOX EXIST AND IS IT LARGE ENOUGH? */ if TEST4~="" then do CROPBIT=1 parse var cropbox x0 y0 x1 y1 cropwidth=x1-x0 cropheight=y1-y0 if cropwidth < 5 & cropheight < 5 then do CROPBIT=0 x0=0 y0=0 x1=picwidth y1=picheight cropwidth=picwidth-1 cropheight=picheight-1 end end else do x0=0 y0=0 x1=picwidth y1=picheight cropwidth=picwidth-1 cropheight=picheight-1 end /* CONFIG */ if exists("ie:prefs/veroll.cfg") == "1" then do call open("temp","ie:prefs/veroll.cfg","R") values=readln("temp") parse var values ok xroll yroll . call close("temp") end else do xroll=0 yroll=0 end 'FORM "Roll" "Use|Cancel"', 'INTEGER,"X-rollvalue",-'cropwidth','cropwidth','xroll',SLIDER', 'INTEGER,"Y-rollvalue",-'cropheight','cropheight','yroll',SLIDER' values=result parse var values ok xroll yroll . if ok = 0 then exit call open("temp","ie:prefs/veroll.cfg","W") res=writeln("temp",values) call close("temp") /* ROLLER */ if cropbit == 1 then do CROP pic x0 y0 x1 y1 croppic=result PROJECT_SET croppic ZOOM origzoomval end else croppic=pic if xroll ~== 0 then do MARK croppic PRIMARY MARK croppic SECONDARY COMPOSITE xroll 0 MIX 100 rol1=result MARK croppic PRIMARY MARK rol1 SECONDARY if sign(xroll) == "-1" then COMPOSITE cropwidth+xroll 0 MIX 100 else COMPOSITE 0-cropwidth+xroll 0 MIX 100 rol2=result CLOSE rol1 if cropbit == 1 then CLOSE croppic croppic=rol2 end if yroll ~== 0 then do MARK croppic PRIMARY MARK croppic SECONDARY COMPOSITE 0 yroll MIX 100 rol1=result MARK croppic PRIMARY MARK rol1 SECONDARY if sign(yroll) == "-1" then COMPOSITE 0 cropheight+yroll MIX 100 else COMPOSITE 0 0-cropheight+yroll MIX 100 rol2=result CLOSE rol1 if cropbit == 1 then CLOSE croppic else if xroll ~== 0 then CLOSE croppic croppic=rol2 end MARK croppic PRIMARY MARK pic SECONDARY COMPOSITE x0 y0 MIX 100 final=result CLOSE croppic exit /*******************************************************************/ /* This is where control goes when an error code is returned by IE */ /* It puts up a message saying what happened and on which line */ /*******************************************************************/ error: if RC=5 then do IE_TO_FRONT LAST_ERROR 'REQUEST "'||RESULT||'"' exit end else do IE_TO_FRONT LAST_ERROR 'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' ' OK ' exit end